package com.itheima.web.controller;


import com.itheima.web.manager.MapManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MapContriller {
    @Autowired
    MapManager mapManager;
    @GetMapping("/baidumap/users")
    public ResponseEntity findByPage(
            @RequestParam(defaultValue = "1")int pageNum,
            @RequestParam(defaultValue = "10")int pageSize){

        return mapManager.findByPage(pageNum,pageSize);
    }

    @GetMapping("/baidumap/findById")
    public ResponseEntity findBaiduMapById(Integer id){
        Long userId = id.longValue();
        return mapManager.findBaiduMapById(userId);
    }
}
